---
title: "Appendix for 'How Civil Resistance Improves Inclusive Democracy'"
author: "Subindra Bogati, Titik Firawati, Jonathan Pinckney, Ches Thurber"
date: "April 2024"
header-includes:
- \usepackage{pdflscape}
- \usepackage{dcolumn}
- \newcommand{\blandscape}{\begin{landscape}}
- \newcommand{\elandscape}{\end{landscape}}
output: 
  pdf_document:
    toc: true
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = F)
library(dplyr)
library(tidyr)
library(knitr)
library(ggplot2)
library(ggeffects)
library(knitr)
library(modelsummary)
library(kableExtra)
library(sensemakr)

IncDemData <- read.csv("IncDemData_April2024.csv")
IncDemData$region <- factor(IncDemData$region)
```

\newpage

## Variable Definitions

### Units of Analysis

*cowcode*: country code from Correlates of War project

*year*: start year of transition from Pinckney 2021

*endyear*: end year of transition from Pinckney 2021

### Independent Variables

*crt*: if transition was a civil resistance transition from Pinckney 2021

*div_gender*: if CR campaign was diverse in terms of gender, from NAVCO 2.1 for final year of campaign (NA for all non-civil resistance transitions).

*gen_type*: categorical variable based on *div_gender* above as well as *crt*. 0 = non-CRT, 1 = CRT with no gender diversity, 2 = CRT with gender diversity. 

*div_class*: if CR campaign was diverse in terms of class, from NAVCO 2.1 for final year of campaign (NA for all non-civil resistance transitions).

*class_type*: categorical variable based on *div_class* above as well as *crt*.  0 = non-CRT, 1 = CRT with class diversity, 2 = CRT with class diversity. 

*excl_part*: if a politically excluded group participated in the campaign, from Thurber 2018 for final year of campaign (NA for all non-civil resistance transitions).

*eth_type*: categorical variable based on *excl_part* above as well as *crt*. 0 = non-CRT, 1 = CRT with no partiipation by excluded ethnic groups, 2 = CRT with participation by excluded ethnic groups.

### Inclusion Variables

*equality_l1*: VDem Egalitarian Component Index (v2x_egal, v. 11.1, Codebook p. 55). Seeks to measure the extent to which egalitarian principle is achieved. Averages Equal Protection Index (v2xeg_eqprotec), Equal Access Index (v2xeg_eqaccess), and Equal Distribution of Resources Index (v2xeg_eqdr). Lagged to measure the year prior to the transition start year.

*equality_ld5*: The trend in the VDem Egalitarian Component Index (vxx_egal) over the 5 years prior to the transition. Calculated by taking the difference in the index one year prior to transition and five years prior, divided by five.

*equality_t1*: VDEM Egalitaritan Component Index (v2x_egal) in the year after the end of the transition.

*equality_d1*: The difference in the VDem Egalitarian Component Index (v2x_egal), from one year before to one year after the transition.

*equality_t5* :  VDem Egalitaritan Component Index (v2x_egal) five years after the end of the transition.

*equality_d5*: The difference in the VDem Egalitarian Component Index (v2x_egal), from one year before to five years after the transition.

*gender_l1*: Inverse of VDem Exclusion by Gender Index (v2xpe_exlgender). From VDem Codebook v. 11.1 p. 294: "The index is formed by taking the point estimates from a Bayesian factor analysis model of the indicators power distributed bygender (v2pepwgen), equality in respect for civil liberties by gender (v2clgencl), access to public services by gender (v2peapsgen), access to state jobs by gender (v2peasjgen), and access to state business opportunities by gender (v2peasbgen)." We subtract the VDem measure from 1 so that higher values reflect lower levels of exclusion, higher levels of inclusion . Lagged to measure the year prior to the transition start year.

*gender_ld5*: The trend in the VDem Exclusion by Gender Index (v2xpe_exlgender) over the 5 years prior to the transition. Calculated by taking the difference in the index one year prior to transition and five years prior, divided by five. All values are inverted to make positive values reflect increases in inclusion.

*gender_t1*: Inverse of the VDem Exclusion by Gender Index (v2xpe_exlgender) in the year after the end of the transition.

*gender_d1*: The difference in the VDem Exclusion by Gender Index (v2xpe_exlgender), from one year before to one year after the transition. All values are inverted to make positive values reflect increases in inclusion.

*gender_t5* :  Inverse of the VDem Exclusion by Gender Index (v2xpe_exlgender) five years after the end of the transition.

*gender_d5*: The difference in the VDem Exclusion by Gender Index (v2xpe_exlgender), from one year before to five years after the transition. All values are inverted to make positive values reflect increases in inclusion.

*class_l1*: Inverse of VDem Exclusion by Socioeconomic Group Index (v2xpe_exlecon). From VDem Codebook v. 11.1 p. 294: "The index is formed by taking the point estimates from a Bayesian factor analysis model of the indicators power distributed by socio-economic group (v2pepwrses), soci-economic position equality in respect for civil liberties (v2clacjust), access to public services by socio- economic group (v2peapsecon), access to state jobs by socio-economic group (v2peasjsoecon), and access to state business opportunities by socio-economic group (v2peasbecon)." We subtract the VDem measure from 1 so that higher values reflect lower levels of exclusion, higher levels of inclusion. Lagged to measure the year prior to the transition start year.

*class_ld5*: The trend in the VDem Exclusion by Socioeconomic Group Index (v2xpe_exlecon) over the 5 years prior to the transition. Calculated by taking the difference in the index one year prior to transition and five years prior, divided by five. All values are inverted to make positive values reflect increases in inclusion.

*class_t1*: Inverse of the VDem Exclusion by Socioeconomic Group Index (v2xpe_exlecon) in the year after the end of the transition.

*class_d1*: The difference in the VDem Exclusion by Socioeconomic Group Index (v2xpe_exlecon) from one year before to one year after the transition. All values are inverted to make positive values reflect increases in inclusion.

*class_t5* :  Inverse of the VDem Exclusion by Socioeconomic Group Index (v2xpe_exlecon) five years after the end of the transition.

*class_d5*: The difference in the VDem Exclusion by Socioeconomic Group Index (v2xpe_exlecon), from one year before to five years after the transition. All values are inverted to make positive values reflect increases in inclusion.

*ethnicity_l1*: Inverse of VDem Exclusion by Social Group Index (v2xpe_exlsocgr). From VDem Codebook v. 11.1 p. 296: "The index is formed by taking the point estimates from a Bayesian factor analysis model of the indicators power distributed by social group (v2pepwrsoc), social group equality in respect for civil liberties (v2clsocgrp), access to public services by social group (v2peapssoc), access to state jobs by social group (v2peasjsoc), and access to state business opportunities by social group (v2peasbsoc)." We subtract the VDem measure from 1 so that higher values reflect lower levels of exclusion, higher levels of inclusion. Lagged to measure the year prior to the transition start year.

*ethnicity_ld5*: The trend in the VDem Exclusion by Social Group Index (v2xpe_exlsocgr) over the 5 years prior to the transition. Calculated by taking the difference in the index one year prior to transition and five years prior, divided by five. All values are inverted to make positive values reflect increases in inclusion.

*ethnicity_t1*: Inverse of the VDem Exclusion by Social Group Index (v2xpe_exlsocgr) in the year after the end of the transition.

*ethnicity_d1*: The difference in the VDem Exclusion by Social Group Index (v2xpe_exlsocgr) from one year before to one year after the transition. All values are inverted to make positive values reflect increases in inclusion.

*ethnicity_t5* :  Inverse of the VDem Exclusion by Social Group Index (v2xpe_exlsocgr) five years after the end of the transition.

*ethnicity_d5*: The difference in the VDem Exclusion by Social Group Index (v2xpe_exlsocgr), from one year before to five years after the transition. All values are inverted to make positive values reflect increases in inclusion.

*gen_polpart_l1* : VDem's "Women political participation index" (v2x_genpp) that aggregates a measure of female representation in the lower legislative chamber (v2lgfemleg, standardized) and a measure of women's share in the overall distribution of power (v2pepwrgen). See VDem Codebook v. 11.1 p. 303. This measure is taken from the year prior to the transition.

*gen_polpart_ld5* : The trend in the VDem Women political participation index (v2x_genpp) over the five years prior to the transition. Calculated by taking the difference in the index one year prior to transition and five years prior, divided by five.

*gen_polpart_t1* : The VDem Women political participation index (v2x_genpp) in the first year after the end of the transition.

*gen_polpart_d1*: The difference in the VDem Women political participation index (v2x_genpp) from one year before to one year after the transition.

*gen_polpart_t5* : The VDem Women political participation index (v2x_genpp) five years after the end of the transition.

*gen_polpart_d5*: The difference in the VDem Women political participation index (v2x_genpp) from one year before to five years after the transition.

*mobilization_l5* : VDem's "Mass mobilization" variable (v2cagenmob) that asks survey respondents "In this year, how frequent and large have events of mass mobilization been?" Responses are collected on a 5-level scale and converted via VDem's Basian item response measurement model to a 0 to 1 interval. See VDem Codebook v. 11.1 p. 228. This measure is taken five years prior to the transition.

*mobilization_t1*: VDem's "Mass mobilization" variable (v2cagenmob) in the first year after the end of the transition.

*mobilization_d1* : The difference in the VDem "Mass mobilization" variable (v2cagenmob)  from five years before to one year after the transition.

*mobilization_t5*: VDem's "Mass mobilization" variable (v2cagenmob) five years after the end of the transition.

*mobilization_d5* : The difference in the VDem "Mass mobilization" variable (v2cagenmob)  from five years before to five years after the transition.

### Additional Control Variables

*duration*: length of transition in years (*endyear* - *year*).

*polyarchy_l1*: VDem Electoral Democracy Index (v2x_polyarchy), taken in the year before the start of the transition.

*gdppc_l1*: logged GDP per capita from the Maddison Project, taken in the year before the start of the transition.

*civsoc_l1*: VDem Civil Society Participation Index (v2x_cspart), taken in the year before the start of the transition.

*violence*: takes a value of 1 if there is evidence of violence in any year of transition or any of five years prior to start of transition. Evidence of violence includes any of the following: 1) internal conflict in ACD (25 brd threshold), 2) positive codings of a primarily violent campaign in NAVCO, or 3) a primarily nonviolent campaing with positive values of parallel violence (*violsim*) or a violent flank (*violflank*)

*prev_CRT*: takes a value of 1 if a CRT previously occurred in that country.

*CW*: if the transition started during the Cold War (start year is before 1989)

*region*: QoG Project political geographic region. 1 = Eastern Europe and Central Asia, 2 = Latin America and the Caribbean, 3 = Middle East and North Africa, 4 = Sub-Saharan Africa, 5 = Western Europe and North America, 6 = Asia and Pacific. 

*prim_violence*: takes a value of 1 if a transition is determined to occur directly as a result of violent insurgents (i.e. insurgents capture state power directly, or regime change occurs as part of a negotiated peace settlement). Only possible in non-CRTs.

*mob_years*: number of consecutive years of primarily nonviolent mobilization leading into a CRT. Takes a value of NA for non-CRTs.


### Difference in Difference Variables (for panel dataset)
post_crt = Our DiD indicator. This takes the value of 1 in a country-year after a civil resistance transition has taken place.

any_crt = This is the group indicator. It takes the value of 1 for any country that experiences a CRT, both before and after that transition occurs.

post_trans = This is the before/after indicator. It takes a value of 1 for all years after the transition, regardless of whether the transition was a CRT or not. 



\newpage

## Variable Descriptive Statistics

```{r, Variable Summary}

IncDemData_min <- IncDemData %>%
  select(crt, year, duration:CW, equality_d1, gender_d1, class_d1, ethnicity_d1)

varsumtable <- datasummary_skim(IncDemData_min, title = 'Descriptive Summary of Variables', output = 'kableExtra')
varsumtable %>%
  kable_styling(latex_options = c("scale_down","HOLD_position"))
```

\newpage
\blandscape

```{r, Correlation Table}

corrtable <- datasummary_correlation(IncDemData_min, title = 'Correlation of Variables', output = 'kableExtra')

corrtable %>%
 kable_styling(latex_options = c("scale_down","HOLD_position"))

```

\elandscape

\newpage



```{r}
balance <- IncDemData %>%
  select(crt, equality_l1, gender_l1, class_l1, ethnicity_l1, equality_ld5, gender_ld5, class_ld5, ethnicity_ld5, duration, polyarchy_l1, gdppc_l1, civsoc_l1, violence, prev_CRT, CW)

balancetable <- datasummary_balance(~crt, data = balance, fmt = 2, title = "Balance Table: Characteristics of Countries Experiencing CRTs (1)  vs. non-CRTs (0)")

balancetable%>%
 kable_styling(latex_options = c("HOLD_position"))


```


\newpage

## Sequential 1-Year and 5-Year Models

In these alternative model specifications, we start with bivariate models and gradually add controls leading ot the full models presented in the main text. To assess longer term effects, we run parallel sets of models using changes in inclusion 5 years after the transition. We also run models with year (continuous) and regional (categorical) variables to help control for temporal and geographic clustering.

```{r, Equality 1 Year}
Egal1Biv <- lm(equality_d1~crt, data = IncDemData)
Egal1LDV <- lm(equality_d1~crt + equality_l1, data = IncDemData)
Egal1NoTrend <- lm(equality_d1 ~ crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW +  equality_l1, data = IncDemData)
Egal1Full <- lm(equality_d1 ~ crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + equality_l1 + equality_ld5, data = IncDemData)

Equality1yr <- list(
                  "Bivariate" = Egal1Biv,
                  "Prior Inc." = Egal1LDV,
                  "No Trend" = Egal1NoTrend,
                  "Full" = Egal1Full)

Egal1Table <- modelsummary(Equality1yr, stars = T, coef_rename = c("crt" = "CR Transition", "equality_l1" = "Prior Equality", "equality_ld5" = "Prior Eq. Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)", "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = 'Equality Models: 1 Year Post-Transition')

Egal1Table %>% kable_styling(latex_options = "HOLD_position")
```

\newpage

```{r, Equality 5 year}
Egal5Biv <- lm(equality_d5~crt, data = IncDemData)

Egal5LDV <- lm(equality_d5~crt + equality_l1, data = IncDemData)

Egal5NoTrend <- lm(equality_d5~crt  + polyarchy_l1 + gdppc_l1  +  civsoc_l1 + violence + prev_CRT + CW + equality_l1, data = IncDemData)

Egal5Full <- lm(equality_d5~crt  + polyarchy_l1 + gdppc_l1  +  civsoc_l1 + violence + prev_CRT + CW + equality_l1 + equality_ld5, data = IncDemData)

Equality5yr <- list(
                  "Bivariate" = Egal5Biv,
                  "Prior Inc." = Egal5LDV,
                  "No Trend" = Egal5NoTrend,
                  "Full" = Egal5Full)

Egal5Table <- modelsummary(Equality5yr, stars = T, coef_rename = c("crt" = "CR Transition", "equality_l1" = "Prior Equality", "equality_ld5" = "Prior Eq. Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)", "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = 'Equality Models: 5 Years Post-Transition')

Egal5Table %>% kable_styling(latex_options = "HOLD_position")
```


```{r, Equality Year and Region}
Egal1Year <- lm(equality_d1~crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + equality_l1 + equality_ld5 + year, data = IncDemData)

Egal1reg <- lm(equality_d1~crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + equality_l1 + equality_ld5 + region, data = IncDemData)

Egal1regyear <- lm(equality_d1~crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + equality_l1 + equality_ld5 + year + region, data = IncDemData)

YearRegSet <- list("Year" = Egal1Year,
                  "Region" = Egal1reg,
                  "Year and Region" = Egal1regyear)

EgalControlTable <- modelsummary(YearRegSet, stars = T, coef_rename = c("crt" = "CR Transition", "equality_l1" = "Prior Equality",  "equality_ld5" = "Prior Eq. Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War", "year" = "Year", "region2" = "Latin America", "region1" = "E. Europe and C. Asia" , "region4" = "Sub-Saharan Africa" , "region3" = "Middle East and N. Africa", "region5" = "W. Europe and N. Am." , "region6" = "Asia Pacific"), gof_omit = 'DF|Deviance|AIC|BIC', vcov = "stata", title = 'Equality Models: Year and Region Controls (1 Year)')

EgalControlTable %>% kable_styling(latex_options = "HOLD_position")
```



```{r, Gender 1 Year}
Gen1Biv <- lm(gender_d1~crt, data = IncDemData)
Gen1LDV <- lm(gender_d1~crt + gender_l1, data = IncDemData)
Gen1NoTrend <- lm(gender_d1 ~ crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + gender_l1, data = IncDemData)
Gen1Full <- lm(gender_d1 ~ crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + gender_l1 + gender_ld5, data = IncDemData)

Gender1yr <- list(
                  "Bivariate" = Gen1Biv,
                  "Prior Inc." = Gen1LDV,
                  "No Trend" = Gen1NoTrend,
                  "Full" = Gen1Full)

modelsummary(Gender1yr, stars = T, coef_rename = c("crt" = "CR Transition", "gender_l1" = "Prior Gender", "gender_ld5" = "Prior Gen. Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = 'Gender Models: 1 Year Post-Transition')
```


```{r, Gender 5 Year}
Gen5Biv <- lm(gender_d5~crt, data = IncDemData)
Gen5LDV <- lm(gender_d5~crt + gender_l1, data = IncDemData)
Gen5NoTrend <- lm(gender_d5 ~ crt  + duration + polyarchy_l1 + gdppc_l1  + civsoc_l1 + violence + prev_CRT + CW + gender_l1, data = IncDemData)
Gen5Full <- lm(gender_d5 ~ crt  + duration + polyarchy_l1 + gdppc_l1  + civsoc_l1 + violence + prev_CRT + CW + gender_l1 + gender_ld5, data = IncDemData)

Gender5yr <- list(
                  "Bivariate" = Gen5Biv,
                  "Prior Inc." = Gen5LDV,
                  "No Trend" = Gen5NoTrend,
                  "Full" = Gen5Full)

modelsummary(Gender5yr, stars = T, coef_rename = c("crt" = "CR Transition", "gender_l1" = "Prior Gender", "gender_ld5" = "Prior Gen. Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = 'Gender Models: 5 Years Post-Transition')
```


```{r, Gender Time and Region}
Gen1Year <- lm(gender_d1~crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + gender_l1 + gender_ld5 + year, data = IncDemData)

Gen1reg <- lm(gender_d1~crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + gender_l1 + gender_ld5 + region, data = IncDemData)

Gen1regyear <- lm(gender_d1~crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + gender_l1 + gender_ld5 + year + region, data = IncDemData)

GenderTimeRegion <- list("Year" = Gen1Year,
                  "Region" = Gen1reg,
                  "Year and Region" = Gen1regyear)

modelsummary(GenderTimeRegion, stars = T, coef_rename = c("crt" = "CR Transition", "gender_l1" = "Prior Gender",  "gender_ld5" = "Prior Gender Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War", "year" = "Year", "region2" = "Latin America", "region1" = "E. Europe and C. Asia" , "region4" = "Sub-Saharan Africa" , "region3" = "Middle East and N. Africa", "region5" = "W. Europe and N. Am." , "region6" = "Asia Pacific"), gof_omit = 'DF|Deviance|AIC|BIC', vcov = "stata", title = 'Gender Models: Year and Region Controls (1 Year)')
```


```{r, Class 1 Year}
Class1Biv <- lm(class_d1~crt, data = IncDemData)
Class1LDV <- lm(class_d1~crt + class_l1, data = IncDemData)
Class1NoTrend <- lm(class_d1 ~ crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + class_l1, data = IncDemData)
Class1Full <- lm(class_d1 ~ crt  + duration + polyarchy_l1 + gdppc_l1  + civsoc_l1 + violence + prev_CRT + CW + class_l1 + class_ld5, data = IncDemData)

Class1yr <- list(
                  "Bivariate" = Class1Biv,
                  "Prior Inc." = Class1LDV,
                  "No Trend" = Class1NoTrend,
                  "Full" = Class1Full)

modelsummary(Class1yr, stars = T, coef_rename = c("crt" = "CR Transition", "class_l1" = "Prior Class", "class_ld5" = "Prior Class Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)", "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = 'Class Models: 1 Year Post-Transition')
```



```{r, Class 5 Year}
Class5Biv <- lm(class_d5~crt, data = IncDemData)
Class5LDV <- lm(class_d5~crt + class_l1, data = IncDemData)
Class5NoTrend <- lm(class_d5 ~ crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + class_l1, data = IncDemData)
Class5Full <- lm(class_d5 ~ crt  + duration + polyarchy_l1 + gdppc_l1   + civsoc_l1 + violence + prev_CRT + CW + class_l1 + class_ld5, data = IncDemData)

Class5yr <- list(
                  "Bivariate" = Class5Biv,
                  "Prior Inc." = Class5LDV,
                  "No Trend" = Class5NoTrend,
                  "Full" = Class5Full)

modelsummary(Class5yr, stars = T, coef_rename = c("crt" = "CR Transition", "class_l1" = "Prior Class", "class_ld5" = "Prior Class Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = 'Class Models: 5 Years Post-Transition')
```


```{r, Class Year and Region}
Class1Year <- lm(class_d1~crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + class_l1 + class_ld5 + year, data = IncDemData)

Class1reg <- lm(class_d1~crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + class_l1 + class_ld5 + region, data = IncDemData)

Class1regyear <- lm(class_d1~crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + class_l1 + class_ld5 + year + region, data = IncDemData)

ClassTimeRegion <- list("Year" = Class1Year,
                  "Region" = Class1reg,
                  "Year and Region" = Class1regyear)

modelsummary(ClassTimeRegion, stars = T, coef_rename = c("crt" = "CR Transition", "class_l1" = "Prior class",  "class_ld5" = "Prior Class Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War", "year" = "Year", "region2" = "Latin America", "region1" = "E. Europe and C. Asia" , "region4" = "Sub-Saharan Africa" , "region3" = "Middle East and N. Africa", "region5" = "W. Europe and N. Am." , "region6" = "Asia Pacific"), gof_omit = 'DF|Deviance|AIC|BIC', vcov = "stata", title = 'Class Models: Year and Region Controls (1 Year)')
```



```{r, Ethnicity 1 Year}
Eth1Biv <- lm(ethnicity_d1~crt, data = IncDemData)

Eth1LDV <- lm(ethnicity_d1~crt + ethnicity_l1, data = IncDemData)

Eth1NoTrend <- lm(ethnicity_d1 ~ crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + ethnicity_l1, data = IncDemData)

Eth1Full <- lm(ethnicity_d1 ~ crt  + duration + polyarchy_l1 + gdppc_l1  + civsoc_l1 + violence + prev_CRT + CW + ethnicity_l1 + ethnicity_ld5, data = IncDemData)

Eth1yr <- list(
                  "Bivariate" = Eth1Biv,
                  "Prior Inc." = Eth1LDV,
                  "No Trend" = Eth1NoTrend,
                  "Full" = Eth1Full)

modelsummary(Eth1yr, stars = T, coef_rename = c("crt" = "CR Transition", "ethnicity_l1" = "Prior Ethnicity", "ethnicity_ld5" = "Prior Ethnicity Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = 'Ethnicity Models: 1 Year Post-Transition')
```



```{r, Ethnicity 5 Year}
Eth5Biv <- lm(ethnicity_d5~crt, data = IncDemData)
Eth5LDV <- lm(ethnicity_d5~crt + ethnicity_l1, data = IncDemData)
Eth5NoTrend <- lm(ethnicity_d5 ~ crt  + duration + polyarchy_l1 + gdppc_l1  + civsoc_l1 + violence + prev_CRT + CW + ethnicity_l1, data = IncDemData)
Eth5Full <- lm(ethnicity_d5 ~ crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + ethnicity_l1 + ethnicity_ld5, data = IncDemData)

Eth5yr <- list(
                  "Bivariate" = Eth5Biv,
                  "Prior Inc." = Eth5LDV,
                  "No Trend" = Eth5NoTrend,
                  "Full" = Eth5Full)

modelsummary(Eth5yr, stars = T, coef_rename = c("crt" = "CR Transition", "ethnicity_l1" = "Prior Ethnicity", "ethnicity_ld5" = "Prior Eth. Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = 'Ethnicity Models: 5 Years Post-Transition')
```


```{r, Ethnicity Year and Region}
Eth1Year <- lm(ethnicity_d1~crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + ethnicity_l1 + ethnicity_ld5 + year, data = IncDemData)

Eth1reg <- lm(ethnicity_d1~crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + ethnicity_l1 + ethnicity_ld5 + region, data = IncDemData)

Eth1regyear <- lm(ethnicity_d1~crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + ethnicity_l1 + ethnicity_ld5 + year + region, data = IncDemData)

EthTimeRegion <- list("Year" = Eth1Year,
                  "Region" = Eth1reg,
                  "Year and Region" = Eth1regyear)

modelsummary(EthTimeRegion, stars = T, coef_rename = c("crt" = "CR Transition", "ethnicity_l1" = "Prior ethnicity",  "ethnicity_ld5" = "Prior ethnicity Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War", "year" = "Year", "region2" = "Latin America", "region1" = "E. Europe and C. Asia" , "region4" = "Sub-Saharan Africa" , "region3" = "Middle East and N. Africa", "region5" = "W. Europe and N. Am." , "region6" = "Asia Pacific"), gof_omit = 'DF|Deviance|AIC|BIC', vcov = "stata", title = 'Ethnicity Models: Year and Region Controls (1 Year)')
```

\newpage

## Violent Transition Models

These models disaggregate those non-CRTs that were "primarily violent." These cases were coded by hand for whether the transition to democracy that occurred was directly precipitated by armed violence (i.e. armed takeover of the state, or an armed conflict that produced a peace agreement implementing democratic reforms). Coding relied on the NAVCO and ACD datasets as well as secondary sources. The 'violence' control variable is omitted from these models to reduce multicollinearity.


```{r, prim viol}

Egal1Viol <- lm(equality_d1 ~ crt + prim_violence + duration + polyarchy_l1 + gdppc_l1  + civsoc_l1 + prev_CRT + CW + equality_l1 + equality_ld5, data = IncDemData)
#summary(Egal1Full)


Gen1Viol <- lm(gender_d1~crt + prim_violence + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + prev_CRT + CW + gender_l1 + gender_ld5, data = IncDemData)
#summary(Gen1Full)


Class1Viol <- lm(class_d1~crt + prim_violence + duration + polyarchy_l1 + gdppc_l1  + civsoc_l1 +  prev_CRT + CW + class_l1 + class_ld5 , data = IncDemData)
#summary(Class1Full)


Ethnicity1Viol <- lm(ethnicity_d1~crt + prim_violence + duration + polyarchy_l1 + gdppc_l1  + civsoc_l1 + prev_CRT + CW + ethnicity_l1 + ethnicity_ld5, data = IncDemData)
#summary(Ethnicity1Full)



ModelViol <- list("Equality" = Egal1Viol,
                  "Gender" = Gen1Viol,
                  "Class" = Class1Viol,
                  "Ethnicity" = Ethnicity1Viol)

violtable <- modelsummary(ModelViol, stars = T, coef_rename = c("crt" = "CR Transition", "prim_violence" = "Violent Transition", "equality_l1" = "Prior Inclusion", "gender_l1" = "Prior Inclusion", "class_l1" = "Prior Inclusion", "ethnicity_l1" = "Prior Inclusion", "equality_ld5" = "Prior Trend", "gender_ld5" = "Prior Trend", "class_ld5" = "Prior Trend", "ethnicity_ld5" = "Prior Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)", "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC', vcov = "stata", title = 'Primarily Violent Transitions Disaggregated from non-CRTs (1 Year)')

violtable %>% kable_styling(latex_options = "HOLD_position")
```

\newpage 

## NVC Length Models

In these models we investigate the relationship between the length of mobilization (in years) and post-transition inclusion. We look only at CRTs, taking as our independent variable the number of years of continuous and primarily unarmed mobilization prior to the transition. In the first model, we examine the change in equality in the first year after the transition. In the second, we remove the 5-year pre-transition trend variable. This model is thus less likely to "penalize" cases in which mobilization achieved advances in equality prior to regime transition. The third model introduces a squared term for mobilization years to assess the possibility of a curvilinear relationship. The fourth model examines the change in equality five years after the end of the transition. We find no relationships in any model.


```{r, resistance duration}


MobDur1 <- lm(equality_d1 ~ mob_years + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + equality_l1 + equality_ld5, data = IncDemData)

MobDur1_NoTrend <- lm(equality_d1 ~ mob_years + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + equality_l1, data = IncDemData)

MobDur1sq <- lm(equality_d1 ~ I(mob_years^2) + mob_years + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + equality_l1 + equality_ld5, data = IncDemData)

MobDur5 <- lm(equality_d5 ~ mob_years + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + equality_l1 + equality_ld5, data = IncDemData)


MobDur <- list(
                  "1-Year" = MobDur1,
                  "No Trend" = MobDur1_NoTrend,
                  "Squared Term" = MobDur1sq,
                  "5-Year" = MobDur5)

MobDurTable <- modelsummary(MobDur, stars = T, coef_rename = c("mob_years" = "Years of Mobilization", "I(mob_years^2)" = "Mobilization ^2", "equality_l1" = "Prior Equality", "equality_ld5" = "Prior Eq. Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)", "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = 'Effect of years of mobilization within CRTs')

MobDurTable %>% kable_styling(latex_options = "HOLD_position")
```

\newpage


## Mechanism Models

Models for women's political representation and social mobilization, structured as above.

```{r, Gender Pol Rep 1 Year}
GPP1Biv <- lm(gen_polpart_d1~crt, data = IncDemData)

GPP1LDV <- lm(gen_polpart_d1~crt + gen_polpart_l1, data = IncDemData)

GPP1NoTrend <- lm(gen_polpart_d1 ~ crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + gen_polpart_l1, data = IncDemData)

GPP1Full <- lm(gen_polpart_d1 ~ crt  + duration + polyarchy_l1 + gdppc_l1  + civsoc_l1 + violence + prev_CRT + CW + gen_polpart_l1 + gen_polpart_ld5, data = IncDemData)

GPP1yr <- list(
                  "Bivariate" = GPP1Biv,
                  "Prior Inc." = GPP1LDV,
                  "No Trend" = GPP1NoTrend,
                  "Full" = GPP1Full)

GPP1table <- modelsummary(GPP1yr, stars = T, coef_rename = c("crt" = "CR Transition", "gen_polpart_l1" = "Prior Pol. Part.", "gen_polpart_ld5" = "Prior Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = "Women's Political Representation Models: 1 Year Post-Transition")

GPP1table %>% kable_styling(latex_options = "HOLD_position")
```

```{r, Gender Pol Rep 5 Year}
GPP5Biv <- lm(gen_polpart_d5~crt, data = IncDemData)

GPP5LDV <- lm(gen_polpart_d5~crt + gen_polpart_l1, data = IncDemData)

GPP5NoTrend <- lm(gen_polpart_d5 ~ crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + gen_polpart_l1, data = IncDemData)

GPP5Full <- lm(gen_polpart_d5 ~ crt  + duration + polyarchy_l1 + gdppc_l1  + civsoc_l1 + violence + prev_CRT + CW + gen_polpart_l1 + gen_polpart_ld5, data = IncDemData)

GPP5yr <- list(
                  "Bivariate" = GPP5Biv,
                  "Prior Inc." = GPP5LDV,
                  "No Trend" = GPP5NoTrend,
                  "Full" = GPP5Full)

GPP5table <- modelsummary(GPP5yr, stars = T, coef_rename = c("crt" = "CR Transition", "gen_polpart_l1" = "Prior Pol. Part.", "gen_polpart_ld5" = "Prior Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = "Women's Political Representation Models: 5 Years Post-Transition")

GPP5table %>% kable_styling(latex_options = "HOLD_position")
```

```{r, Gender Pol Rep Year and Region}
GPP1Year <- lm(gen_polpart_d1~crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + gen_polpart_l1 + gen_polpart_ld5 + year, data = IncDemData)

GPP1reg <- lm(gen_polpart_d1~crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + gen_polpart_l1 + gen_polpart_ld5 + region, data = IncDemData)

GPP1regyear <- lm(gen_polpart_d1~crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + gen_polpart_l1 + gen_polpart_ld5 + year + region, data = IncDemData)

GPPYearRegSet <- list("Year" = GPP1Year,
                  "Region" = GPP1reg,
                  "Year and Region" = GPP1regyear)

GPPControlTable <- modelsummary(GPPYearRegSet, stars = T, coef_rename = c("crt" = "CR Transition", "gen_polpart_l1" = "Prior Gender Rep.",  "gen_polpart_ld5" = "Prior Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War", "year" = "Year", "region2" = "Latin America", "region1" = "E. Europe and C. Asia" , "region4" = "Sub-Saharan Africa" , "region3" = "Middle East and N. Africa", "region5" = "W. Europe and N. Am." , "region6" = "Asia Pacific"), gof_omit = 'DF|Deviance|AIC|BIC', vcov = "stata", title = "Women's Political Representation Models: Year and Region Controls (1 Year)")

GPPControlTable %>% kable_styling(latex_options = "HOLD_position")
```

```{r, Mobilization 1 Year}
Mob1Biv <- lm(mobilization_d1~crt, data = IncDemData)

Mob1LDV <- lm(mobilization_d1~crt + mobilization_l5, data = IncDemData)

Mob1Full <- lm(mobilization_d1 ~ crt  + duration + polyarchy_l1 + gdppc_l1  + civsoc_l1 + violence + prev_CRT + CW + mobilization_l5, data = IncDemData)

Mob1yr <- list(
                  "Bivariate" = Mob1Biv,
                  "Prior Inc." = Mob1LDV,
                  "Full" = Mob1Full)

Mob1table <- modelsummary(Mob1yr, stars = T, coef_rename = c("crt" = "CR Transition", "mobilization_l5" = "Prior Mobilization", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = "Mobilization Models: 1 Year Post-Transition")

Mob1table %>% kable_styling(latex_options = "HOLD_position")
```

```{r, Mobilization 5 Year}
Mob5Biv <- lm(mobilization_d5~crt, data = IncDemData)

Mob5LDV <- lm(mobilization_d5~crt + mobilization_l5, data = IncDemData)

Mob5Full <- lm(mobilization_d5 ~ crt  + duration + polyarchy_l1 + gdppc_l1  + civsoc_l1 + violence + prev_CRT + CW + mobilization_l5, data = IncDemData)

Mob5yr <- list(
                  "Bivariate" = Mob5Biv,
                  "Prior Inc." = Mob5LDV,
                  "Full" = Mob5Full)

Mob5table <- modelsummary(Mob5yr, stars = T, coef_rename = c("crt" = "CR Transition", "mobilization_l5" = "Prior Mobilization", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = "Mobilization Models: 5 Years Post-Transition")

Mob5table %>% kable_styling(latex_options = "HOLD_position")
```

```{r, Mobilization Year and Region}
Mob1Year <- lm(mobilization_d1~crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + mobilization_l5 + year, data = IncDemData)

Mob1reg <- lm(mobilization_d1~crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + mobilization_l5 + region, data = IncDemData)

Mob1regyear <- lm(mobilization_d1~crt  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + mobilization_l5 + year + region, data = IncDemData)

MobYearRegSet <- list("Year" = Mob1Year,
                  "Region" = Mob1reg,
                  "Year and Region" = Mob1regyear)

MobControlTable <- modelsummary(MobYearRegSet, stars = T, coef_rename = c("crt" = "CR Transition", "mobilization_l5" = "Prior Mobilization", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War", "year" = "Year", "region2" = "Latin America", "region1" = "E. Europe and C. Asia" , "region4" = "Sub-Saharan Africa" , "region3" = "Middle East and N. Africa", "region5" = "W. Europe and N. Am." , "region6" = "Asia Pacific"), gof_omit = 'DF|Deviance|AIC|BIC', vcov = "stata", title = 'Mobilization Models: Year and Region Controls (1 Year)')

MobControlTable %>% kable_styling(latex_options = "HOLD_position")
```

\newpage

## Participation Models

In these models, CRTs are disaggregated by whether or not the civil resistance campaing prompting the transition included participation by members of marginalized groups specific to each dimension of gender, class, and ethnicity.

```{r, Gender Part 1}
IncDemData$gen_type <- factor(IncDemData$gen_type)
GenPart1Biv <- lm(gender_d1~gen_type, data = IncDemData)
GenPart1LDV <- lm(gender_d1~gen_type + gender_l1, data = IncDemData)
GenPart1NoTrend <- lm(gender_d1 ~ gen_type  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW+ gender_l1, data = IncDemData)
GenPart1Full <- lm(gender_d1 ~ gen_type  + duration + polyarchy_l1 + gdppc_l1  + civsoc_l1 + violence + prev_CRT + CW+ gender_l1 + gender_ld5, data = IncDemData)

GenderPart1yr <- list(
                  "Bivariate" = GenPart1Biv,
                  "Prior Inc." = GenPart1LDV,
                  "No Trend" = GenPart1NoTrend,
                  "Full" = GenPart1Full)

GenPart1Table <- modelsummary(GenderPart1yr, stars = T, coef_rename = c("gen_type1" = "CRT No Gender Div." , "gen_type2" = "CRT Yes Gender Div.", "gender_l1" = "Prior Gender", "gender_ld5" = "Prior Gen. Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = "Gender Participation: 1-Year Post-Transition")

GenPart1Table %>% kable_styling(latex_options = "HOLD_position")
```


```{r, Gender Part 5}
GenPart5Biv <- lm(gender_d5~gen_type, data = IncDemData)
GenPart5LDV <- lm(gender_d5~gen_type + gender_l1, data = IncDemData)
GenPart5NoTrend <- lm(gender_d5 ~ gen_type  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW+ gender_l1, data = IncDemData)
GenPart5Full <- lm(gender_d5 ~ gen_type  + duration + polyarchy_l1 + gdppc_l1  + civsoc_l1 + violence + prev_CRT + CW + gender_l1 + gender_ld5, data = IncDemData)

GenderPart5yr <- list(
                  "Bivariate" = GenPart5Biv,
                  "Prior Inc." = GenPart5LDV,
                  "No Trend" = GenPart5NoTrend,
                  "Full" = GenPart5Full)

modelsummary(GenderPart5yr, stars = T, coef_rename = c("gen_type1" = "CRT No Gender Div." , "gen_type2" = "CRT Yes Gender Div.", "gender_l1" = "Prior Gender", "gender_ld5" = "Prior Gen. Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = "Gender Participation: 5-Years Post-Transition")
```


```{r, Gen Part Controls}
GenPart1Year <- lm(gender_d1~gen_type  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + gender_l1 + gender_ld5 + year, data = IncDemData)

GenPart1reg <- lm(gender_d1~gen_type  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + gender_l1 + gender_ld5 + region, data = IncDemData)

GenPart1regyear <- lm(gender_d1~gen_type  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + gender_l1 + gender_ld5 + year + region, data = IncDemData)

GenderPartTimeRegion <- list("Year" = GenPart1Year,
                  "Region" = GenPart1reg,
                  "Year and Region" = GenPart1regyear)

modelsummary(GenderPartTimeRegion, stars = T, coef_rename = c("gen_type1" = "CRT No Gender Div." , "gen_type2" = "CRT Yes Gender Div.", "gender_l1" = "Prior Gender",  "gender_ld5" = "Prior Gender Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War", "year" = "Year", "region2" = "Latin America", "region1" = "E. Europe and C. Asia" , "region4" = "Sub-Saharan Africa" , "region3" = "Middle East and N. Africa", "region5" = "W. Europe and N. Am." , "region6" = "Asia Pacific"), gof_omit = 'DF|Deviance|AIC|BIC', vcov = "stata", title = "Gender Participation: Year and Region Controls")
```



```{r, Class Part 1}
IncDemData$class_type <- factor(IncDemData$class_type)
ClassPart1Biv <- lm(class_d1~class_type, data = IncDemData)
ClassPart1LDV <- lm(class_d1~class_type + class_l1, data = IncDemData)
ClassPart1NoTrend <- lm(class_d1 ~ class_type  + duration + polyarchy_l1 + gdppc_l1  + civsoc_l1 + violence + prev_CRT + CW + class_l1, data = IncDemData)
ClassPart1Full <- lm(class_d1 ~ class_type  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + class_l1 + class_ld5, data = IncDemData)

ClassPart1yr <- list(
                  "Bivariate" = ClassPart1Biv,
                  "Prior Inc." = ClassPart1LDV,
                  "No Trend" = ClassPart1NoTrend,
                  "Full" = ClassPart1Full)

modelsummary(ClassPart1yr, stars = T, coef_rename = c("class_type1" = "CRT No Class Div.", "class_type2" = "CRT Yes Class Div.", "class_l1" = "Prior Class", "class_ld5" = "Prior Class Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)", "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = "Class Participation: 1-Year Post-Transition")
```


```{r, Class Part 5}
ClassPart5Biv <- lm(class_d5~class_type, data = IncDemData)
ClassPart5LDV <- lm(class_d5~class_type + class_l1, data = IncDemData)
ClassPart5NoTrend <- lm(class_d5 ~ class_type  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + class_l1, data = IncDemData)
ClassPart5Full <- lm(class_d5 ~ class_type  + duration + polyarchy_l1 + gdppc_l1  + civsoc_l1 + violence + prev_CRT + CW + class_l1 + class_ld5, data = IncDemData)

ClassPart5yr <- list(
                  "Bivariate" = ClassPart5Biv,
                  "Prior Inc." = ClassPart5LDV,
                  "No Trend" = ClassPart5NoTrend,
                  "Full" = ClassPart5Full)

modelsummary(ClassPart5yr, stars = T, coef_rename = c("class_type1" = "CRT No Class Div.", "class_type2" = "CRT Yes Class Div.", "class_l1" = "Prior Class", "class_ld5" = "Prior Class Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = "Class Participation: 5-Years Post-Transition")
```



```{r, Class Part Controls}
ClassPart1Year <- lm(class_d1~class_type  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + class_l1 + class_ld5 + year, data = IncDemData)

ClassPart1reg <- lm(class_d1~class_type  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + class_l1 + class_ld5 + region, data = IncDemData)

ClassPart1regyear <- lm(class_d1~class_type  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + class_l1 + class_ld5 + year + region, data = IncDemData)

ClassPartTimeRegion <- list("Year" = ClassPart1Year,
                  "Region" = ClassPart1reg,
                  "Year and Region" = ClassPart1regyear)

modelsummary(ClassPartTimeRegion, stars = T, coef_rename = c("class_type1" = "CRT No Class Div.", "class_type2" = "CRT Yes Class Div.", "class_l1" = "Prior class",  "class_ld5" = "Prior Class Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War", "year" = "Year", "region2" = "Latin America", "region1" = "E. Europe and C. Asia" , "region4" = "Sub-Saharan Africa" , "region3" = "Middle East and N. Africa", "region5" = "W. Europe and N. Am." , "region6" = "Asia Pacific"), gof_omit = 'DF|Deviance|AIC|BIC', vcov = "stata", title = "Class Participation: Year and Region Controls")
```



```{r, Eth Part 1}
IncDemData$eth_type <- factor(IncDemData$eth_type)
EthPart1Biv <- lm(ethnicity_d1~eth_type, data = IncDemData)

EthPart1LDV <- lm(ethnicity_d1~eth_type + ethnicity_l1, data = IncDemData)

EthPart1NoTrend <- lm(ethnicity_d1 ~ eth_type  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + ethnicity_l1, data = IncDemData)

EthPart1Full <- lm(ethnicity_d1 ~ eth_type  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + ethnicity_l1 + ethnicity_ld5, data = IncDemData)

EthPart1yr <- list(
                  "Bivariate" = EthPart1Biv,
                  "Prior Inc." = EthPart1LDV,
                  "No Trend" = EthPart1NoTrend,
                  "Full" = EthPart1Full)

modelsummary(EthPart1yr, stars = T, coef_rename = c("eth_type1" = "CRT No Excl. Part", "eth_type2" = "CRT Yes Excluded Part", "ethnicity_l1" = "Prior Ethnicity", "ethnicity_ld5" = "Prior Ethnicity Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = "Ethnic Participation: 1-Year Post-Transition")
```



```{r, Eth Part 5}
EthPart5Biv <- lm(ethnicity_d5~eth_type, data = IncDemData)
EthPart5LDV <- lm(ethnicity_d5~eth_type + ethnicity_l1, data = IncDemData)
EthPart5NoTrend <- lm(ethnicity_d5 ~ eth_type  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + ethnicity_l1, data = IncDemData)
EthPart5Full <- lm(ethnicity_d5 ~ eth_type  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + ethnicity_l1 + ethnicity_ld5, data = IncDemData)

EthPart5yr <- list(
                  "Bivariate" = EthPart5Biv,
                  "Prior Inc." = EthPart5LDV,
                  "No Trend" = EthPart5NoTrend,
                  "Full" = EthPart5Full)

modelsummary(EthPart5yr, stars = T, coef_rename = c("eth_type1" = "CRT No Excl. Part", "eth_type2" = "CRT Yes Excluded Part", "ethnicity_l1" = "Prior Ethnicity", "ethnicity_ld5" = "Prior Eth. Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War"), gof_omit = 'DF|Deviance|AIC|BIC|F', vcov = "stata", title = "Ethnic Participation: 5-Years Post-Transition")
```

,

```{r Eth Part Controls}
EthPart1Year <- lm(ethnicity_d1~eth_type  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + ethnicity_l1 + ethnicity_ld5 + year, data = IncDemData)

EthPart1reg <- lm(ethnicity_d1~eth_type  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + ethnicity_l1 + ethnicity_ld5 + region, data = IncDemData)

EthPart1regyear <- lm(ethnicity_d1~eth_type  + duration + polyarchy_l1 + gdppc_l1 + civsoc_l1 + violence + prev_CRT + CW + ethnicity_l1 + ethnicity_ld5 + year + region, data = IncDemData)

EthPartTimeRegion <- list("Year" = EthPart1Year,
                  "Region" = EthPart1reg,
                  "Year and Region" = EthPart1regyear)

modelsummary(EthPartTimeRegion, stars = T, coef_rename = c("eth_type1" = "CRT No Excl. Part", "eth_type2" = "CRT Yes Excluded Part", "ethnicity_l1" = "Prior ethnicity",  "ethnicity_ld5" = "Prior ethnicity Trend", "duration" = "Duration", "polyarchy_l1" = "VDem Polyarchy", "civsoc_l1"="Civil Society", "gdppc_l1" = "GDP pc (log)",  "violence" = "Violence", "prev_CRT" = "Prior CRT", "CW" = "Cold War", "year" = "Year", "region2" = "Latin America", "region1" = "E. Europe and C. Asia" , "region4" = "Sub-Saharan Africa" , "region3" = "Middle East and N. Africa", "region5" = "W. Europe and N. Am." , "region6" = "Asia Pacific"), gof_omit = 'DF|Deviance|AIC|BIC', vcov = "stata", title = "Ethnic Participation: Year and Region Controls")
```

\newpage

## Sensitivity Analyses

The sensitivity analyses below are based on the 1-year full models for each inclusion measure  (i.e. Table 2 Models 1-4 in the main text). The rv_q values report the amount of unexplained variance in both X and Y that an unobserved confounder would have to explain in order to produce a coefficient of "0" for "crt." The rv_qa reports he amount of unexplained variance in both X and Y that an unobserved confounder would have to explain in order to produce a result that falls below statistical significance at an alpha level of 0.05.

To help interpret the likelihood of such an unobserved confounder, the plots on the next page compares these levels to those of the prior inclusion measure included in each model (i.e. level of inclusion in the year prior to transition). It shows what the t-value of the coefficient estimate for CRT would be if an unobserved confounder were as strongly correlated with X and Y as prior inclusion, twice as strongly correlated, and three times as strongly correlated. Points above and to the right of the red curve indicate levels of an unobserved confounder that would render the coefficient estimate for crt not statistically significant. 

```{r}
Egal1Full_Sens <- sensemakr(model = Egal1Full,
                         treatment = "crt",
                         benchmark_covariates = "equality_l1",
                         kd=1:3)

Egal1Full_SensStats <- Egal1Full_Sens[["sensitivity_stats"]] %>%
  mutate(Model = "Equality 1yr Full")

Gen1Full_Sens <- sensemakr(model = Gen1Full,
                         treatment = "crt",
                         benchmark_covariates = "gender_l1",
                         kd=1:3)

Gen1Full_SensStats <- Gen1Full_Sens[["sensitivity_stats"]]%>%
  mutate(Model = "Gender 1yr Full")



Class1Full_Sens <- sensemakr(model = Class1Full,
                         treatment = "crt",
                         benchmark_covariates = "class_l1",
                         kd=1:3)

Class1Full_SensStats <- Class1Full_Sens[["sensitivity_stats"]]%>%
  mutate(Model = "Class 1yr Full")


Eth1Full_Sens <- sensemakr(model = Eth1Full,
                         treatment = "crt",
                         benchmark_covariates = "ethnicity_l1",
                         kd=1:3)

Eth1Full_SensStats <- Eth1Full_Sens[["sensitivity_stats"]]%>%
  mutate(Model = "Ethnicity 1yr Full")

SensStats <- bind_rows(Egal1Full_SensStats, Gen1Full_SensStats, Class1Full_SensStats, Eth1Full_SensStats)%>%
  select(Model, estimate:t_statistic, rv_q, rv_qa)

kable(SensStats, caption = "Sensitivity Analysis for all 1 Year Models") %>% kable_styling(latex_options = "HOLD_position")

```


### Sensitivity Analyses - Prior Inclusion Benchmarks

```{r, fig.width= 3.5}
plot(Egal1Full_Sens, sensitivity.of = "t-value")
plot(Gen1Full_Sens, sensitivity.of = "t-value")
plot(Class1Full_Sens, sensitivity.of = "t-value")
plot(Eth1Full_Sens, sensitivity.of = "t-value")
```

\newpage

## Sensitivity Analyses - Participation

Sensitivity analysis based on participation models. CRTs with participation from respective marginalized groups used as treatment, with Non-CRTs and CRTs without participation alternately used as the reference. When Non-CRTs are the reference, rv_q and rv_qa values assess the strength of a hypothetical omitted variable needed to create no difference or no statistically significant difference between CRTs that included participation and non-CRTs. When CRTs without participation are the reference, the rv_q and rv_qa values assess the strength of a hypothetical omitted variable needed to create no difference or no statistically significant difference between CRTs that included participation by marginalized groups and CRTs that did not.

```{r}

GenPart_Sens <- sensemakr(estimate = .057, se = .020, dof = 239)

GenPart_SensStats <- GenPart_Sens[["sensitivity_stats"]]%>%
  mutate(Treatment = "Gender Div.",
         Reference = "Non-CRT")



ClassPart_Sens <- sensemakr(estimate = .045, se = .017, dof = 239)

ClassPart_SensStats <- ClassPart_Sens[["sensitivity_stats"]]%>%
  mutate(Treatment = "Class Div.",
         Reference = "Non-CRT")


EthPart_Sens <- sensemakr(estimate = .073, se = .025, dof = 236)

EthPart_SensStats <- EthPart_Sens[["sensitivity_stats"]]%>%
  mutate(Treatment = "Excl. Part",
         Reference = "Non-CRT")

GenPartRelevel_Sens <- sensemakr(estimate = .062, se = .025, dof = 239)

GenPartRelevel_SensStats <- GenPartRelevel_Sens[["sensitivity_stats"]]%>%
  mutate(Treatment = "Gender Div.",
         Reference = "No Gender Div.")



ClassPartRelevel_Sens <- sensemakr(estimate = .067, se = .022, dof = 239)

ClassPartRelevel_SensStats <- ClassPartRelevel_Sens[["sensitivity_stats"]]%>%
  mutate(Treatment = "Class Div.",
         Reference = "No Class Div.")


EthPartRelevel_Sens <- sensemakr(estimate = .030, se = .028, dof = 236)

EthPartRelevel_SensStats <- EthPartRelevel_Sens[["sensitivity_stats"]]%>%
  mutate(Treatment = "Yes Excl. Part.",
         Reference = "No Excl Part.")

PartSensStats <- bind_rows(GenPart_SensStats, GenPartRelevel_SensStats, ClassPart_SensStats, ClassPartRelevel_SensStats, EthPart_SensStats, EthPartRelevel_SensStats)%>%
  select(Treatment, Reference, estimate:t_statistic, rv_q, rv_qa)

kable(PartSensStats, caption = "Sensitivity analyses for participation models.") %>% kable_styling(latex_options = "HOLD_position")

```

\newpage

## Difference in Difference Analysis

We further assess the robustness of our findings with a Difference in Difference analysis. We switch to using time-series cross-national data (i.e. country-years). To focus our analysis on theoretically relevant periods, we take only the country-years ranging from years five years before through ten years after a transition. Our dependent variable becomes the absolute measures (no longer the difference) for overall equality and the gender, class, and ethnic dimensions. We identify `CRT countries` as the treated group (those countries that experience a CRT as opposed to a non-CRT). We designate `After Transition` years as those that come after any transition in a country. Years after a CRT transition (i.e. treated group  x after treatment) are coded as `After CRT`. The coefficient for this variable is our difference in difference estimator: the difference in the expected equality score before versus after a CRT as compared to the difference before versus after a non-CRT. 

In our first set of models, we simply include these three terms. In a second set, we replace the dummy indicator `CRT countries` with country-level fixed effects, and in a third we run country and year "two-way" fixed effects. The results in all models show the expected positive and statistically significant correlations for the DiD estimator `After CRT`.


```{r, echo = F, warning = F, message = F}

library(plm)

IncDem_Panel <- read.csv("IncDemData_TSCS_April2024.csv")
IncDem_Panel$COWcode <- factor(IncDem_Panel$COWcode)

Egal_DiD <- lm(equality ~ post_crt +  any_crt + post_trans, data = IncDem_Panel)

Gen_DiD <- lm(gender ~ post_crt +  any_crt + post_trans, data = IncDem_Panel)

Class_DiD <- lm(class ~ post_crt +  any_crt + post_trans, data = IncDem_Panel)

Eth_DiD <- lm(ethnicity ~ post_crt +  any_crt + post_trans, data = IncDem_Panel)


SimpleDiDs <- list(
                  "Equality" = Egal_DiD,
                  "Gender" = Gen_DiD,
                  "Class" = Class_DiD,
                  "Ethnicity" = Eth_DiD)

DiDTable <- modelsummary(SimpleDiDs, stars = T, vcov = "Stata", coef_rename = c("post_crt" = "After CRT", "post_trans" = "After Transition", "any_crt" = "CRT Country"), gof_omit = 'DF|Deviance|AIC|BIC|F', title = 'Difference in Difference Models')

DiDTable %>% kable_styling(latex_options = "HOLD_position")

```

```{r, echo = F}

Egal_DiD_CFE <- plm(equality ~ post_crt + post_trans, data = IncDem_Panel, index = c("COWcode"), model = "within")

Gen_DiD_CFE <- plm(gender ~ post_crt + post_trans, data = IncDem_Panel, index = c("COWcode"), model = "within")

Class_DiD_CFE <- plm(class ~ post_crt + post_trans, data = IncDem_Panel, index = c("COWcode"), model = "within")

Eth_DiD_CFE <- plm(ethnicity ~ post_crt + post_trans, data = IncDem_Panel, index = c("COWcode"), model = "within")

CFEDiDs <- list(
                  "Equality" = Egal_DiD_CFE,
                  "Gender" = Gen_DiD_CFE,
                  "Class" = Class_DiD_CFE,
                  "Ethnicity" = Eth_DiD_CFE)

CFEDiDTable <- modelsummary(CFEDiDs, stars = T, vcov = "Stata", coef_rename = c("post_crt" = "After CRT", "post_trans" = "After Transition"), gof_omit = 'DF|Deviance|AIC|BIC|F', title = 'Difference in Difference: Country Fixed Effects')

CFEDiDTable %>% kable_styling(latex_options = "HOLD_position")

```

```{r, echo = F}

Egal_DiD_TWFE <- plm(equality ~ post_crt + post_trans, data = IncDem_Panel, index = c("COWcode", "year"), model = "within", effect = "twoways")

Gen_DiD_TWFE <- plm(gender ~ post_crt + post_trans, data = IncDem_Panel, index = c("COWcode", "year"), model = "within", effect = "twoways")

Class_DiD_TWFE <- plm(class ~ post_crt + post_trans, data = IncDem_Panel, index = c("COWcode", "year"), model = "within", effect = "twoways")

Eth_DiD_TWFE <- plm(ethnicity ~ post_crt + post_trans, data = IncDem_Panel, index = c("COWcode", "year"), model = "within", effect = "twoways")

TWFEDiDs <- list(
                  "Equality" = Egal_DiD_TWFE,
                  "Gender" = Gen_DiD_TWFE,
                  "Class" = Class_DiD_TWFE,
                  "Ethnicity" = Eth_DiD_TWFE)

TWFEDiDTable <- modelsummary(TWFEDiDs, stars = T, vcov = "Stata", coef_rename = c("post_crt" = "After CRT", "post_trans" = "After Transition"), gof_omit = 'DF|Deviance|AIC|BIC|F', title = 'Difference in Difference: Country and Year Two-Way Fixed Effects')

TWFEDiDTable %>% kable_styling(latex_options = "HOLD_position")

```